package com.kuson.springcloud.service.impl;

import com.kuson.springcloud.entities.CommonResult;
import com.kuson.springcloud.entities.Payment;
import com.kuson.springcloud.service.PaymentService;
import org.springframework.stereotype.Component;

/**
 * 微服务调用失败后，最后的兜底的方法。比如服务提供者宕机了。
 */
@Component
public class PaymentFallbackService implements PaymentService {
    @Override
    public CommonResult<Payment> paymentSQL(Long id) {
        return new CommonResult<>(44444,"服务降级返回,---PaymentFallbackService",new Payment(id,"errorSerial"));

    }
}
